import request from '@/config/axios'

// 用户留言 VO
export interface UserLeaveMessageVO {
  id: number // 主键
  userId: number // 用户编号
  anonymityName: string // 匿名名称
  anonymityAvatar: string // 匿名头像
  content: string // 留言内容
  likedCount: number // 被赞总次数
  validTime: Date // 有效时间
  status: boolean // 状态（0正常 1禁用）
}

// 用户留言 API
export const UserLeaveMessageApi = {
  // 查询用户留言分页
  getUserLeaveMessagePage: async (params: any) => {
    return await request.get({ url: `/business/user-leave-message/page`, params })
  },

  // 查询用户留言详情
  getUserLeaveMessage: async (id: number) => {
    return await request.get({ url: `/business/user-leave-message/get?id=` + id })
  },

  // 新增用户留言
  createUserLeaveMessage: async (data: UserLeaveMessageVO) => {
    return await request.post({ url: `/business/user-leave-message/create`, data })
  },

  // 修改用户留言
  updateUserLeaveMessage: async (data: UserLeaveMessageVO) => {
    return await request.put({ url: `/business/user-leave-message/update`, data })
  },

  // 删除用户留言
  deleteUserLeaveMessage: async (id: number) => {
    return await request.delete({ url: `/business/user-leave-message/delete?id=` + id })
  },

  // 导出用户留言 Excel
  exportUserLeaveMessage: async (params) => {
    return await request.download({ url: `/business/user-leave-message/export-excel`, params })
  },
}